package top.someapp.applib.bean;

import java.util.Objects;

/**
 * 使用Long类型的值作为标识符的模型
 *
 * @author zwz
 * Created on 2020-06-08
 */
public class LongIdModel implements Model<Long> {

    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        LongIdModel that = (LongIdModel) o;
        return Objects.equals(id, that.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
